<!--
 * Copyright 2011 Andrey Vyrvich.
 * andry.virvich at google.com
 -->

<html>
  <head>
	<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.base64.min.js"></script>
    <script type="text/javascript" src="js/soapclient.js"></script>
	<script type="text/javascript" src="js/xsddate.js"></script>
	<script type="text/javascript" src="js/animatedIcon.js"></script>
    <script type="text/javascript" src="js/filters.js"></script>
    <script type="text/javascript" src="js/loader.js"></script>
    <!--script type="text/javascript" src="js/jquery.md5.js"></script>
    <script type="text/javascript" src="js/jira.server.js"></script-->
	<script>
	//localStorage.setItem('omniboxEnabled', (typeof localStorage.getItem('omniboxEnabled') == 'boolean')?localStorage.getItem('omniboxEnabled'):false);
	function Auth(){
		if(localStorage.getItem("url"))
		{
			loader.url = localStorage.getItem("url");
			loader.login(localStorage.getItem("username"), localStorage.getItem("password"), function(){
				loader.update();
			});
		} else {
		
			chrome.browserAction.setIcon({ 'path' : 'images/logo-19-off.png'});
			chrome.browserAction.setBadgeText({text: ''});
			loader.options();
		}
	}
	Auth();
	
	
			
		/*
		chrome.omnibox.onInputChanged.addListener(  function(text, suggest) {
			console.log(localStorage.getItem('omniboxEnabled') == 'true');
			if(localStorage.getItem('omniboxEnabled') == 'true'){
				loader.getIssuesFromTextSearchWithLimit(text, function(xhr){
					var data = [];
					$(xhr).find("multiRef").each(function(i, val) {
						if($("key", val).text()){
							data.push({
								content: $("key", val).text(),
								description: $("key", val).text() +": "+$("summary", val).text()
							})
						}
					});
					suggest(data);
				});
			}
		  });
		
		chrome.omnibox.onInputEntered.addListener(function(text) {
			if(localStorage.getItem('omniboxEnabled') == 'true'){
				loader.redirect(loader.url +"/browse/"+ text);
			}
		});	  
		  */
	</script>
 </head>
  <body></body>
</html> 